package com.nutricia.common.api;

import com.nutricia.common.api.request.CreateSystemPermissionReq;
import com.nutricia.common.api.request.DeleteSystemPermissionReq;
import com.nutricia.common.api.request.GetMenuPermissionReq;
import com.nutricia.common.api.request.GetPermissionByRoleIdReq;
import com.nutricia.common.api.request.UpdateSystemPermissionReq;
import com.nutricia.common.api.request.VoidRequest;
import com.nutricia.common.api.result.CreateSystemPermissionRes;
import com.nutricia.common.api.result.GetMenuUnionPermissionRes;
import com.nutricia.common.api.result.GetPermissionByRoleIdRes;
import com.nutricia.common.api.result.GetSystemPermissionRes;
import com.nutricia.common.api.result.VoidResult;

import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 系统权限
 *
 * @author: huangsheng
 * @date: 2017/10/24 下午3:03
 */
@RestController
@RequestMapping("/systemPermission")
public interface SystemPermissionFacade {

    /**
     * 获取某个菜单系统权限数据
     *
     * @author: huangsheng
     * @date: 2017/10/24 下午2:31
     */
    @RequestMapping("getSystemMenuPermission")
    GetSystemPermissionRes getMenuPermission(@RequestBody GetMenuPermissionReq getMenuPermissionReq);

    /**
     * 获取所有菜单联合菜单权限的数据
     *
     * @author: huangsheng
     * @date: 2017/10/24 下午6:08
     */
    @RequestMapping("getSystemMenuUnionPermission")
    GetMenuUnionPermissionRes getMenuUnionPermission(@RequestBody VoidRequest voidRequest);

    /**
     * 获取角色拥有的权限数据
     *
     * @author: huangsheng
     * @date: 2017/10/24 下午9:27
     */
    @PostMapping("getSystemRolePermission")
    GetPermissionByRoleIdRes getPermissionByRoleId(@RequestBody GetPermissionByRoleIdReq getPermissionByRoleIdReq);

    /**
     * 新增系统权限数据
     *
     * @author: huangsheng
     * @date: 2017/10/24 上午10:38
     */
    @RequestMapping("createSystemPermission")
    CreateSystemPermissionRes createSystemPermission(@RequestBody CreateSystemPermissionReq createSystemPermissionReq);

    /**
     * 更新系统权限数据
     *
     * @author: huangsheng
     * @date: 2017/10/24 上午10:38
     */
    @RequestMapping("updateSystemPermission")
    VoidResult updateSystemPermission(@RequestBody UpdateSystemPermissionReq updateSystemPermissionReq);

    /**
     * 删除系统权限数据（逻辑删除）
     *
     * @author: huangsheng
     * @date: 2017/10/24 上午10:38
     */
    @RequestMapping("deleteSystemPermission")
    VoidResult deleteSystemPermission(@RequestBody DeleteSystemPermissionReq deleteSystemPermissionReq);
}
